//
//  FieldViewController.m
//  Qya
//
//  Created by shoguncao on 12-9-9.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "FieldViewController.h"
#import "FeedsDetailViewController.h"
#import "MyQYaViewController.h"

@interface FieldViewController ()

@end

@implementation FieldViewController
@synthesize btField;
@synthesize messageCountImageView;
@synthesize keywordLabel;
@synthesize topFlag;
@synthesize notifyFlag;
@synthesize number;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        isTop = NO;
        isNotify = NO;
        [btField setImage:[UIImage imageNamed:@"coffee"] forState:UIControlStateNormal];
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [self setMessageCountImageView:nil];
    [self setKeywordLabel:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (IBAction)onTop:(id)sender {
    if (isTop == NO) {
        [topFlag setImage:[UIImage imageNamed:@"zhidinganniukaiqi"] forState:UIControlStateNormal];
        isTop = YES;
    }
    else {
        [topFlag setImage:[UIImage imageNamed:@"zhidinganniuguanbi"] forState:UIControlStateNormal];
        isTop = NO;
    }
}

- (IBAction)onIsNotify:(id)sender {
    if (isNotify == NO) {
        [notifyFlag setImage:[UIImage imageNamed:@"tixinganniukaiqi"] forState:UIControlStateNormal];
        isNotify = YES;
    }
    else {
        [notifyFlag setImage:[UIImage imageNamed:@"tixinganniuguanbi"] forState:UIControlStateNormal];
        isNotify = NO;
    }
}

- (IBAction)seeField:(id)sender
{
    [[MyQYaViewController sharedKeyWordViewController] gotoDetail:number];
//    fdVC = [[FeedsDetailViewController alloc]initWithNibName:@"FeedsDetailViewController" bundle:nil];
//    [self.navigationController pushViewController:fdVC.view animated:YES]; 
}
@end
